﻿@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_JuiLayout.cshtml";

    string hostId = MyRequest.GetQueryString("hostId");
    string userName = selectControlBLL.getNameById("id", hostId, "Sys_IBUsers", "RealName");


    string rturl = "/SysMenu/List?menu=SysIBUserFunctions&name=ListById&hostId="+hostId;
}
@section header {}
<div id="layout" class="noNavTab">
    <div id="navTab">
        <div class="pageContent">
            <h2 class="contentTitle">
                添加用户功能权限</h2>
            <div class="pageFormContent nowrap" layouth="56">
                @{
                    
                    using (Html.BeginForm("AddUserFunction", "SysMenu", new { tname = DencryptHelper.Encrypt("Sys_IBUserFunctions"), url = rturl }, FormMethod.Post, new { @class = "pageForm required-validate", onsubmit = "return validateCallback(this,navTabAjaxDone)" }))
                    { 
                    <dl>
                        <dt>
                            用户：
                        </dt>
                        <dd>
                            @userName
                            @Html.Hidden("t0_UserId", hostId, new { @class = "digits required textInput" })
                        </dd>
                    </dl>
                    <dl>
                        <dt>功能名称：</dt>
                        <dd>
                            <select name='t0_FunctionId' id='t0_FunctionId' class='required'>
                            @{Html.RenderPartial("~/Views/Shared/selectControl.ascx", SysMenu.getFunction("IsValid", "1"));}
                            </select>
                        </dd>
                    </dl>
                    <dl>
                        <dt>有权限：</dt>
                        <dd>
                            <label>
                            @Html.RadioButton("t0_HasRight", "true",true)是</label>
                            <label>
                            @Html.RadioButton("t0_HasRight", "false")否</label>
                        </dd>
                    </dl>
                    <dl id="p_level">
                        
                        @{Html.RenderPartial("~/views/SysMenu/SysIBUserFunctions/UserLevel.ascx");}
                    </dl>   
                    <dl>
                        <dt>&nbsp</dt>
                        <dd>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="submit">
                                        添加</button></div>
                            </div>
                        </dd>
                        <dd>
                            <a class="button" href=@rturl><span>返回</span></a></dd>
                    </dl>
                    } 
                }
            </div>
        </div>
    </div>
</div>

<link href="../../content/jui-normal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
        $('#t0_FunctionId').change(function () {
            var v=$(this).val();
            if (v == "") {
                $('#p_level').html('');
            }
            else {
                $('#p_level').load('/SysMenu/Userlevel', { v: v }, function () {
                    if (isDWZInit) { initUI('#p_level'); }
                    
                });
            }
        });
    });
</script>

